﻿/*
    File name:          LightSensor
    File type:          Class
    Author:             Sune Krog-Meyer 09888
    Creation date:      03-04-2011
    Description:        Contains lightsensorfunktions for the robot.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using i4pro_gruppe_d.ControllerCommunication;
using i4pro_gruppe_d.RobotCommunication;
using i4pro_gruppe_d.SimulatorAdaptor;

namespace i4pro_gruppe_d.Hardware
{
    public class LightSensor
    {
        private IControllerCommunication _lightSensor;

        /// <summary>
        /// Classconstructor
        /// </summary>
        /// <param name="physical"> True if robot, flase if simulator </param>
        public LightSensor(bool physical)
        {
            if(physical)
            {
                _lightSensor = new ConcreteDLLAdaptor();   
            }
            else
            {
                _lightSensor = new ConcreteSimulatorAdaptor();
            }
        }

        /// <summary>
        /// Activates checks on the lightsensor
        /// </summary>
        public void ActivateLightsensor()
        {
            Console.WriteLine(_lightSensor.activateLightsensor() ? "LightSensor Activation: Succes" : "LightSensor Activation: Failed");            
        }

        /// <summary>
        /// Deactivates checks on the lightsensor
        /// </summary>
        public void DeactivateLightsensor()
        {
            Console.WriteLine(_lightSensor.deactivateLightsensor() ? "LightSensor Deactivation: Succes" : "LightSensor Deactivation: Failed");
        }
    }
}
